<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>clearCompiledTemplate()</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="api.functions.html" title="Chapter 14. Smarty Class Methods">
<link rel="prev" href="api.clear.cache.html" title="clearCache()">
<link rel="next" href="api.clear.config.html" title="clearConfig()">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">clearCompiledTemplate()</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="api.clear.cache.html">Prev</a> </td>
<th width="60%" align="center">Chapter 14. Smarty Class Methods</th>
<td width="20%" align="right"> <a accesskey="n" href="api.clear.config.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="refentry" title="clearCompiledTemplate()">
<a name="api.clear.compiled.tpl"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>clearCompiledTemplate() — clears the compiled version of the specified template resource</p>
</div>
<div class="refsect1" title="Description">
<a name="id429013"></a><h2>Description</h2>
<code class="methodsynopsis"><span class="type">void </span><span class="methodname">clearCompiledTemplate</span>(<span class="methodparam"><span class="type">string </span><span class="parameter">tpl_file</span></span>,<br>                           <span class="methodparam"><span class="type">string </span><span class="parameter">compile_id</span></span>,<br>                           <span class="methodparam"><span class="type">int </span><span class="parameter">exp_time</span></span>);</code><p>
   This clears the compiled version of the specified template
   resource, or all compiled template files if one is not specified.
   If you pass a
   <a class="link" href="variable.compile.id.html" title="$compile_id"><em class="parameter"><code>$compile_id</code></em></a>
   only the compiled template for this specific
   <a class="link" href="variable.compile.id.html" title="$compile_id"><em class="parameter"><code>$compile_id</code></em></a>
   is cleared. If you pass an exp_time, then only
   compiled templates older than <em class="parameter"><code>exp_time</code></em> seconds are
   cleared, by default all compiled templates are cleared regardless of their age.
   This function is for advanced use only, not normally needed.
  </p>
<div class="example">
<a name="id429576"></a><p class="title"><b>Example 14.12. clearCompiledTemplate()</b></p>
<div class="example-contents"><pre class="programlisting">

&lt;?php
// clear a specific template resource
$smarty-&gt;clearCompiledTemplate('index.tpl');

// clear entire compile directory
$smarty-&gt;clearCompiledTemplate();
?&gt;

   </pre></div>
</div>
<br class="example-break"><p>See also
  <a class="link" href="api.clear.cache.html" title="clearCache()"><code class="varname">clearCache()</code></a>.
  </p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="api.clear.cache.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="api.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="api.clear.config.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">clearCache() </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> clearConfig()</td>
</tr>
</table>
</div>
</body>
</html>
